package com.then.component.login.ui.register;

import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.ViewModel;

import com.blankj.utilcode.util.EncryptUtils;
import com.then.architecture.data.dto.Resource;
import com.then.architecture.data.dto.SimpleEntity;
import com.then.component.login.dto.Auth;
import com.then.component.login.dto.Login;
import com.then.component.login.dto.LoginSimpleEntity;
import com.then.component.login.repository.LoginRepository;
import com.then.component.login.request.CheckNickNameReq;
import com.then.component.login.request.CompleteFindPwdReq;
import com.then.component.login.request.CompleteRegisterReq;
import com.then.component.login.request.FindPwdReq;
import com.then.component.login.request.IsPhoneRegisterReq;
import com.then.component.login.request.RegisterReq;
import com.then.component.login.request.SendSmsReq;

import javax.inject.Inject;

/**
 * Created by 42524 on 2018/1/11.
 */

public class RegisterCompleteActivityViewModel extends ViewModel {

    LoginRepository loginRepository;

    @Inject
    public RegisterCompleteActivityViewModel(LoginRepository loginRepository) {
        this.loginRepository = loginRepository;
    }


    public LiveData<Resource<SimpleEntity>> registerComplete(String country, String phoneNum, String authCode, String pwd, String displayName, String pwdAgain, String sex) {
        return loginRepository.completeRegister(new CompleteRegisterReq(country, phoneNum, authCode, pwd, displayName, pwdAgain, sex));
    }

    public LiveData<Resource<SimpleEntity>> checkNickName(String nickName) {
        return loginRepository.checkNickname(new CheckNickNameReq(nickName));
    }


}
